function GET(url,dataObj,fun){
    dataObj.time = getTime();
    wx.request({
        url: url,
        data: dataObj,
        method: 'GET',
        dataType: 'json',
        success: (res) => { 
          if(res.data.error_code === 0){
            fun(res.data);
          }else{
              fun(res);
          }
        },
        fail: (res) => {
            console.log("请求失败");
            console.log(res);
        }
      });
}


//返回十位时间戳
function getTime(){
  let tmp = new Date().getTime().toString();
  tmp = tmp.substr(0,10);
  return tmp;
} 



module.exports = {
    GET:GET
}
    